package com.contest.util;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 查询参数
 */
public class Query extends LinkedHashMap<String, Object> {
	private static final long serialVersionUID = 1L;
	// 
	private int page;
	// 每页条数
	private int rows;

	public Query(Map<String, Object> params) {
		this.putAll(params);
		// 分页参数
		this.page = Integer.parseInt(params.get("page").toString());
		this.rows = Integer.parseInt(params.get("rows").toString());
		this.put("page", (page-1)*rows);
		this.put("rows", rows);
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}
}
